﻿@model ZBJF.Warranty.Model.ViewModel.Sellers.SellerEmployeeModel
<div class="desc_forward_title" onclick="history.back(-1)">
    修改密码
</div>
<div class="space-4"></div>
@using (Html.BeginForm("SaveModifyPassword", "SellerEmpoyee", FormMethod.Post, new { id = "modifyPasswordForm" }))
{
    @Html.AntiForgeryToken()
    @Html.HiddenFor(m => m.ID)
    @Html.HiddenFor(m => m.ModifyPasswordType)
    @Html.HiddenFor(m => m.UserPhone)/*用户没有登录时，修改密码的用户就是UserPhone根据此字段来修改密码*/
    <div class="weui-cells weui-cells_form">
        @if (Model.ModifyPasswordType == 2)
        {
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label w-100">旧密码</label>
                </div>
                <div class="weui-cell__bd weui-cell_primary">
                    @Html.PasswordFor(o => o.Password, new { @class = "weui-input", placeholder = "请输入旧密码", validate = "{required:true,messages:{required:'请输入旧密码'}}" })
                </div>
            </div>
        }
        <div class="weui-cell">
            <div class="weui-cell__hd">
                <label class="weui-label w-100">新密码</label>
            </div>
            <div class="weui-cell__bd weui-cell_primary">
                @Html.PasswordFor(o => o.NewPassword, new { @class = "weui-input", placeholder = "请输入新密码", validate = "{required:true,messages:{required:'请输入新密码'}}" })
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd">
                <label class="weui-label w-100">确认密码</label>
            </div>
            <div class="weui-cell__bd weui-cell_primary">
                @Html.PasswordFor(o => o.ConfirmNewPassword, new { @class = "weui-input", placeholder = "请再次输入新密码", validate = "{required:true,equalTo:NewPassword,messages:{required:'请再次输入新密码',equalTo:'请输入相同的密码'}}" })
            </div>
        </div>
    </div>
    <div class="margin-t-30 w-p90">
        <a href="javascript:void(0)" class="weui-form-preview__btn weui-form-preview__btn_primary border-radius-6" onclick="if ($('#modifyPasswordForm').valid()) { $('#modifyPasswordForm').submit(); } else { return false };">
            确定
        </a>
    </div>
}
